package OOAE_UWE.Assessment;

public class CleanState implements State {
    @Override
    public boolean canSwitch(State newState) {
        return (newState instanceof DirtyState) || (newState instanceof OfflineState);
    }

    @Override
    public boolean isAvailableForRent() {
        return true;
    }

    @Override
    public boolean equals(Object obj) {//override the compare method in clean 、 dirty 、 offline state
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        return true;
    }

    @Override
    public String toString() {
        return "Clean";
    }
}
